package com.yingside.gui.lovo;

import com.lovo.netCRM.component.LovoButton;
import com.lovo.netCRM.component.LovoCheckBox;
import com.lovo.netCRM.component.LovoLabel;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Arrays;

public class TypePanel extends JPanel {
    private LovoLabel lovoLabel;
    private LovoCheckBox checkBox;
    private LovoButton btn;
    public TypePanel() {
        this.setLayout(null);
        lovoLabel = new LovoLabel("类型管理",100,50,this);

        checkBox = new LovoCheckBox("你喜欢的类型：",
                new String[]{"肌肉猛男","文质彬彬","帅气奶狗","霸道总裁"},
                50,
                100,
                this);

        btn = new LovoButton("确定",100,150,this);

        checkBox.setSelectItem(new String[]{"是","是","否","是"});

        btn.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                String[] selectItem = checkBox.getSelectItem();
                System.out.println("Arrays.toString(selectItem) = " + Arrays.toString(selectItem));
            }
        });

        this.setBounds(300, 300, 400, 400);

    }
}
